class Product
  attr_accessor :id, :name, :price, :pic, :desc
  
  def initialize(id, name, price, pic, desc)
    self.id = id
    self.name = name
    self.price = price
    self.pic = pic
    self.desc = desc
  end
  
  def self.get_products_by_category category_id

    ProductInfo.new.get_products category_id

  end

  def self.find_sales
    # AQUI VAMOS TER QUE CHAMAR ALGUM COMPONENTE
    # product1 = Product.new(1, 'product1', 50, 'http://i.s8.com.br/images/games/cover_tn/img3/pq24108233.jpg')
    # product2 = Product.new(2, 'product2', 30, 'http://i.s8.com.br/images/games/cover_tn/img0/pq24073640.jpg')
    # [product1, product2]

    ProductInfo.new.get_products 2

  end
  
  def self.find(id)
    ProductInfo.new.get_product id
  end
  
  def self.search(for_word)
    ProductInfo.new.search for_word
  end
end
